<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="./css/bootstrap.min.css" rel="stylesheet">
<link href="./css/font-awesome.min.css" rel="stylesheet">
<link href="./css/animate.min.css" rel="stylesheet">
<link href="css/jquery-confirm.css" rel="stylesheet">
<link href="./css/plugins/summernote/summernote.css" rel="stylesheet">
<link href="./css/plugins/summernote/summernote-bs3.css"
	rel="stylesheet">
<link href="./css/style.min.css" rel="stylesheet">
<link href="css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<script src="./js/My97DatePicker/WdatePicker.js"></script>
<script src="js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="js/jquery.min.js"></script>
<script type="text/javascript" src="./js/img_upload.js"></script>
<script type="text/javascript" src="./js/fileUploadUtil.js"></script>
<script src="js/plugins/modal/bootstrap-modal.js"></script>
<script src="js/jquery-confirm.js"></script>
<script src="js/common.js"></script>
<title>滨海基金 -客户详情</title>
<style type="text/css">
/* dataTables列内容居中 */  
	.table>tbody>tr>td{  
	        text-align:center;  
	}  
	/* dataTables表头居中 */  
	.table>thead:first-child>tr:first-child>th{  
	        text-align:center;  
	}  
</style>
</head>
<body class="gray-bg">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
					<h5>
						客户 <small>详情</small>
					</h5>
					<div class="ibox-tools">
						<a class="btn  btn-sm btn-bitbucket" id="add"> <i
							class="fa fa-reply"></i> 移交
						</a> <a class="btn  btn-sm btn-bitbucket" href="toCustomer.do"> <i
							class="fa fa-reply"></i> 返回
						</a>
					</div>
				</div>

				<div class="ibox-content">
					<form role="form" class="form-horizontal m-t" id="myFrom"
						enctype="multipart/form-data">
						<div class="row form-body form-horizontal m-t">
							<div class="col-md-6 droppable sortable">
								<div class="form-group draggable">
									<label class="col-sm-8 control-label">客户姓名<span
										style="color: red;">*</span>：
									</label>
									<div class="col-sm-4">
										<p class="form-control-static">${customer.customerName }</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-8 control-label">性别<span
										style="color: red;">*</span>：
									</label>
									<div class="col-sm-4">
										<p class="form-control-static">${customer.sex }</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-8 control-label">出生日期：</label>
									<div class="col-sm-4">
										<p class="form-control-static">
											<fmt:formatDate value="${customer.birthday }" type="date" />
										</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-8 control-label">籍贯：</label>
									<div class="col-sm-4">
										<p class="form-control-static">${customer.birthPlace }</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-8 control-label">手机号码<span
										style="color: red;">*</span>：
									</label>
									<div class="col-sm-4">
										<p class="form-control-static">${customer.mobileNumber }</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-8 control-label">证件类型：</label>
									<div class="col-sm-4">
										<p class="form-control-static">
											<c:if test="${customer.idType eq 0}">身份证</c:if>
											<c:if test="${customer.idType eq 1}">军警证</c:if>
											<c:if test="${customer.idType eq 2}">护照</c:if>
											<c:if test="${customer.idType eq 3}">港澳通行证</c:if>
											<c:if test="${customer.idType eq 4}">其他</c:if>
										</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-8 control-label">家庭住址<span
										style="color: red;">*</span>：
									</label>
									<div class="col-sm-4">
										<p class="form-control-static">${customer.address }</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-8 control-label">职业<span
										style="color: red;">*</span>：
									</label>
									<div class="col-sm-4">
										<p class="form-control-static">${customer.profession }</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-8 control-label">客户类型<span
										style="color: red;">*</span>：
									</label>
									<div class="col-sm-4">
										<p class="form-control-static">
											<c:if test="${customer.customerType eq 0}">自然人</c:if>
											<c:if test="${customer.customerType eq 1}">老总</c:if>
											<c:if test="${customer.customerType eq 2}">部门经理</c:if>
											<c:if test="${customer.customerType eq 3}">部门主管</c:if>
											<c:if test="${customer.customerType eq 4}">普通员工</c:if>
											<c:if test="${customer.customerType eq 5}">法人</c:if>
										</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-8 control-label">公司名称：
									</label>
									<div class="col-sm-4">
										<p class="form-control-static">${customer.company }</p>
									</div>
								</div>
							</div>
							<div class="col-md-6 droppable sortable">
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">婚姻状况：</label>
									<div class="col-sm-8">
										<p class="form-control-static">
											<c:if test="${customer.maritalStatus eq 0}">未婚</c:if>
											<c:if test="${customer.maritalStatus eq 1}">已婚</c:if>
											<c:if test="${customer.maritalStatus eq 2}">离异</c:if>
											<c:if test="${customer.maritalStatus eq 3}">丧偶</c:if>
										</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">照片：</label>
									<div class="col-sm-8">
										<img alt="" width="100" height="80" src="${customer.picture }">
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">网址：</label>
									<div class="col-sm-8">
										<p class="form-control-static">${customer.url }</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">学历：</label>
									<div class="col-sm-8">
										<p class="form-control-static">
											<c:if test="${customer.educationBackground eq 0}">大专</c:if>
											<c:if test="${customer.educationBackground eq 1}">本科</c:if>
											<c:if test="${customer.educationBackground eq 2}">硕士</c:if>
											<c:if test="${customer.educationBackground eq 3}">博士</c:if>
											<c:if test="${customer.educationBackground eq 4}">其他</c:if>
										</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">证件号码：</label>
									<div class="col-sm-8">
										<p class="form-control-static">${customer.idNumber }</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">客户来源：</label>
									<div class="col-sm-8">
										<p class="form-control-static">
											<c:if test="${customer.customerSource eq 0}">公海池</c:if>
											<c:if test="${customer.customerSource eq 1}">市场活动</c:if>
											<c:if test="${customer.customerSource eq 2}">录入客户</c:if>
										</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">公司地址：
									</label>
									<div class="col-sm-8">
										<p class="form-control-static">${customer.companySite }</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">座机号码：</label>
									<div class="col-sm-8">
										<p class="form-control-static">${customer.phone }</p>
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">传真号码：</label>
									<div class="col-sm-8">
										<p class="form-control-static">${customer.facsimile }</p>
									</div>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<div class="modal fade  " id='addRoleModal'>
			<div class="modal-dialog" style="width: 700px; height: 600px;">
				<div class="modal-content">
					<div class="modal-header">
						<button class="close" data-dismiss='modal'>×</button>

						<h2 class="modal-title" align="center">移交客户</h2>
					</div>

					<div class="modal-body" align="center">

						<form id="myFrom">
							<table align="center">
								<tr style="height: 70px">
									<td><label>接收人<span style="color: red;">*</span>：
									</label></td>
									<td><select id="personLiable" class="form-control"
										name="personLiable"></select></td>
								</tr>
								<tr style="height: 70px">
									<td><label>批量交接： </label></td>
									<td><input type="radio" checked="checked" name="batch"
										value="0" /> 否 <input type="radio" name="batch" value="1" />
										是</td>
								</tr>
							</table>
						</form>

					</div>
					<div class="modal-footer" align="center">
						<div align="center">
							<button class="btn btn-primary" id="btnAdd">确认</button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			$(function() {
				$("#add").click(
						function() {
							$("#addRoleModal").modal("show");
							//请求员工数据
							$.ajax({
								url : "askEmployee.do",
								type : "post",
								dataType : "json",
								success : function(result) {
									if (result.code == 1) {
										var emp = result.data;
										for (var i = 0; i < emp.length; i++) {
											$("#personLiable").append(
													"<option value="+emp[i].employeeId+" >"
															+ emp[i].name
															+ "</option>");
										}
									} else {
										sweetAlert("异常", "请求数据失败!", "error");
									}

								},
								error : function() {
									sweetAlert("异常", "网络出现异常!", "error");
								}

							});// ajax end;
						})

				//添加角色操作
				$("#btnAdd").click(
						function() {
							var personLiable = $("#personLiable").val();
							var batch = $("input[type='radio']:checked").val();
							alert(batch);
							if (personLiable == "") {
								swal("提示!", "请选择接收人!", "error");
								return;
							}
							$.ajax({
								url : "transferCustomer.do?batch=" + batch
										+ "&personLiable=" + personLiable,
								type : "post",
								dataType : "json",
								success : function(result) {
									if (result.code == 1) {
										swal({
											title : "提示",
											text : "移交成功！",
											type : "success",
											confirmButtonText : "确定",
											closeOnConfirm : false
										}, function() {
											location = "toCustomer.do";
										});

									} else if (result.code == 0) {
										sweetAlert("异常", "暂无数据!", "error");
									} else {
										sweetAlert("异常", "出现未知错误!", "error");
									}

								},
								error : function() {
									sweetAlert("异常", "网络出现异常!", "error");
								}

							});// ajax end;
						});
			})
		</script>
</body>
</html>